//package work.rightAnswer;
//
//import java.util.Arrays;
//import java.util.Comparator;
//
//class Solution_452 {
//    public int findMinArrowShots(int[][] points) {
//        //排序
//        Arrays.sort(points, Comparator.comparingInt(a -> a[0]));
//
//        //贪心，逻辑很简单，既能射爆当前气球，又能射爆尽可能多的气球
//        //左边界left 右边界right 所需箭数量 count
//        // 初始化 left = points[0][0] right = points[0][1]
//        //遍历 points 1.if(points[i][0]>right) count++ ,left=points[i][0] right=points[i][1]
//        //2.if(points[i][0]<=right) left=points[i][0],right=Math.min(right,points[i][1]);
//        int left = points[0][0];
//        int right = points[0][1];
//        int count = 0;
//        for (int i = 1; i < points.length; i++) {
//            if(points[i][0]>right){
//                count++;
//                left = points[i][0];
//                right = points[i][1];
//            }else {
//                left = points[i][0];
//                right = Math.min(right,points[i][1]);
//            }
//        }
//        count++;
//
//        return count;
//    }
//}